Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS 20241 - autosuggest/typeahead/combobox address for facility locator #34361

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

eselkin
Copy link
Contributor

@eselkin eselkin commented Jan 29, 2025

Are you removing, renaming or moving a folder in this PR?

  • No, I'm not changing any folders (skip to TeamSites and delete the rest of this section)
  • Yes, I'm removing, renaming or moving a folder

Did you change site-wide styles, platform utilities or other infrastructure?

Summary

  • Adds the Typeahead component inside the facility-locator application directory. For use in FL projects. Here it is used by the AddressTypeahead component to suggest correct city/zip/locations.
  • Sitewide team
  • flipper to be used is: facilities_use_address_typeahead

Related issue(s)

PR for flipper
department-of-veterans-affairs/vets-api#20516

Testing done

  • The address/city/state/zip field is just a text input, now when the flipper is enabled, it allows for the user to receive autosuggest options for the city/state, zip, address so they know they are picking the right city/town/zipcode/country

Screenshots

New Autosuggest for find-locations
https://github.com/user-attachments/assets/7ac0ad4f-1b21-4748-b2b9-256b8d5136de

What areas of the site does it impact?

Affects the zip code/city,state field of the Facility Locator

Acceptance criteria

Provides up to 5 mapbox found locations for a user input.

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

Requested Feedback

Check /find-locations

@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main January 29, 2025 02:05 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main January 29, 2025 05:12 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main January 30, 2025 00:07 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main January 30, 2025 17:47 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main January 31, 2025 01:17 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main January 31, 2025 04:38 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main January 31, 2025 05:58 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main February 4, 2025 21:54 Inactive
Copy link
Contributor

@randimays randimays left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some observations:

  1. If I select an option from the dropdown, then go back and edit it, ignoring the dropdown options, the search term in the result string is not updated.
Screen.Recording.2025-02-05.at.9.45.39.AM.mov
  1. If I've already selected an option from the dropdown, then I click "Use my location," nothing happens.
Screen.Recording.2025-02-05.at.9.51.24.AM.mov
  1. Similarly, if I have an option from the dropdown, then clear that option and click "Use my location," nothing happens. I can see a geocoding call in the network tab happening, so perhaps it's having trouble replacing the input value?
Screen.Recording.2025-02-05.at.9.56.09.AM.mov
  1. This is likely out-of-scope because it's also a thing in prod, but I'm curious: are we not wanting to enforce that people choose a city when searching? Noticing I can search for "Oklahoma" in both this local build and prod.

return (
<span className="usa-input-error-message" role="alert">
<span className="sr-only">Error</span>
Please fill in a city, state, or postal code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We stopped using Please in other apps per DS recommendations; should we be using it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being updated in the progressive disclosure ticket. We're also changing the string associated with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can update here to be in line with that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to update it here to be in line with DS standards (if we know what it should be).

proximity: 'ip',
})
.send();
// TODO: display error message if geolocation fails?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need to be handled before we can merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an old issue and possible a zero silent failures concern. I removed, but we probably need to handle. It's direct with mapbox that the issue may happen.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is handling this in scope for this ticket? If not, could we spin up a new ticket for this and add the ticket # as part of this comment please?

….com:department-of-veterans-affairs/vets-website into VACMS-20241-autosuggest-valid-address-mapbox
return (
<span className="usa-input-error-message" role="alert">
<span className="sr-only">Error</span>
Please fill in a city, state, or postal code.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being updated in the progressive disclosure ticket. We're also changing the string associated with it.

return (
<span className="usa-input-error-message" role="alert">
<span className="sr-only">Error</span>
Please fill in a city, state, or postal code.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can update here to be in line with that.

@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main February 5, 2025 18:45 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main February 5, 2025 18:57 Inactive
@eselkin eselkin requested a review from randimays February 5, 2025 21:29
@randimays
Copy link
Contributor

If the component allows a free-text response, should it be doing its "best guess" matching against responses that don't quite make sense? A couple of examples where I typed some junk and it searched for one of the suggestions that wasn't selected:

Screen.Recording.2025-02-06.at.6.44.19.AM.mov
Screen.Recording.2025-02-06.at.6.41.39.AM.mov

…arching will be the same as what is searched when typed
@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main February 6, 2025 17:01 Inactive
@eselkin
Copy link
Contributor Author

eselkin commented Feb 6, 2025

So the reason we weren't getting the search terms in the AutosuggestOptions was because I was testing without country in that box but it was still searching country with the search button. Now they show the same thing, but both behaviors are what are seen in production. Mapbox doesn't understand misspelled Carolina even if the stuff before it make sense.

@randimays
Copy link
Contributor

@eselkin Not sure I understand. I think the root of my question is: if you type something in the search box and do not select any of the dropdown options, shouldn't it search for exactly what you typed rather than trying to pick a suggestion?

@eselkin
Copy link
Contributor Author

eselkin commented Feb 7, 2025

That is the effect. It is searching for what you typed. Unfortunately the search comes back with what mapbox says it thinks you meant.

@randimays
Copy link
Contributor

I finished functional testing on my end - just a couple comments left in the diffs still.

It's hard to wrap my brain around whether this will work 100% for VA health services autosuggest at this stage; I think we'll find out when we get there.

@va-vfs-bot va-vfs-bot temporarily deployed to master/VACMS-20241-autosuggest-valid-address-mapbox/main February 11, 2025 22:35 Inactive
….com:department-of-veterans-affairs/vets-website into VACMS-20241-autosuggest-valid-address-mapbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants